<style type="text/css">@import url("modules/Dashboard/activities.css"); </style>
<h3>{$modStrings.LBL_ACTIVITIES_TITLE}</h3>
<br>
{include file='modules/Dashboard/activities_filter.tpl' assign=activities_filter}
{$activities_filter}
<div id="container">
    <table id ="main" cellpadding="0" cellspacing="0">
        <tr>
            <td>&nbsp;</td>
            {foreach from=$months key=label item=month}
            <td colspan="4">{$month.title}</td>
            {/foreach}
            <td>&nbsp;</td><td>&nbsp;</td>
        </tr>
        <tr>
            <td>{$modStrings.LBL_CONSULTANT_NAME}</td>
            {foreach from=$months key=label item=month}
                <td class="meeting">{$modStrings.LBL_M}</td><td class="call">{$modStrings.LBL_C}</td><td>{$modStrings.LBL_MC}</td><td class="opp">{$modStrings.LBL_O}</td>
            {/foreach}
            <td>{$modStrings.LBL_ALL_MC}</td><td class="opp">{$modStrings.LBL_ALL_O}</td>
        </tr>
    {foreach from=$cities key=label item=city name=citiesArr}
    <tr><td colspan="{$collspan}" class="cityName alignLeft"><b>{$city.name}</b></td></tr>
        {foreach from=$cityUser key=label item=cu name=cityUserArr}
            {if $cu.city_id eq $city.id}
            <tr>
                <td class="alignLeft">{$cu.userName}</td>
                {foreach from=$months key=label item=month name=monthsArr}
                    {foreach from=$data key=label item=d name=dataArr}
                        {if $d.city_id eq $city.id AND $d.userId eq $cu.userId AND $d.yearMonth eq $month.id}
                        <td class="meeting">{$d.m}</td>
                        <td class="call">{$d.c}</td>
                        <td>{$d.mc}</td>
                        <td class="opp">{$d.o}</td>
                        {/if}
                    {/foreach}
                {/foreach}
                {if $smarty.foreach.monthsArrr.last}
                    {foreach from=$userSummaryData key=label item=usd name=usdArr}
                        {if $usd.userId eq $cu.userId AND $usd.city_id eq $city.id}
                        <td>{$usd.mc}</td><td class="opp">{$usd.o}</td>
                        {/if}
                    {/foreach}
                {/if}
            </tr>
            {/if}
            {if $smarty.foreach.cityUserArr.last}
                <tr>
                    <td class="alignLeft"><b>{$city.name} - suma</b></td>
                {foreach from=$months key=label item=month name=monthsArr}
                   {foreach from=$cityData key=label item=cd name=cdArr}
                        {if $cd.yearMonth eq $month.id AND $cd.city_id eq $city.id}
                        <td class="meeting">{$cd.m}</td><td class="call">{$cd.c}</td><td>{$cd.mc}</td><td class="opp">{$cd.o}</td>
                        {/if}
                   {/foreach}
                {/foreach}

                {foreach from=$citySumData key=label item=citySum name=citySumDataArr}
                    {if $city.id eq $citySum.city_id}
                        <td>{$citySum.mc}</td><td class="opp">{$citySum.o}</td>
                    {/if}
                {/foreach}

                </tr>
            {/if}
        {/foreach}
    {/foreach}
    <tr>
        <td class="alignLeft"><b>{$modStrings.LBL_ALL}</b></td>
    {foreach from=$months key=label item=month name=monthsArr}
        {foreach from=$summaryData key=label item=summary name=msummarysArr}
            {if $summary.yearMonth eq $month.id}
            <td class="meeting">{$summary.m}</td><td class="call">{$summary.c}</td><td>{$summary.mc}</td><td class="opp">{$summary.o}</td>
            {/if}
        {/foreach}
    {/foreach}
    <td>{$allMC}</td><td class="opp">{$allO}</td>
    </tr>
    </table>
    
    <br>
    <table>
        <tr>
            <td>{$modStrings.LBL_M}</td><td>-&nbsp;{$modStrings.LBL_M_DESC}</td>
        </tr>
        <tr>
            <td>{$modStrings.LBL_C}</td><td>-&nbsp;{$modStrings.LBL_C_DESC}</td>
        </tr>
        <tr>
            <td>{$modStrings.LBL_O}</td><td>-&nbsp;{$modStrings.LBL_O_DESC}</td>
        </tr>
    </table>
</div>